package spotGUI.sideBar;

import java.awt.Component;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.Box;
import javax.swing.ImageIcon;
import javax.swing.JEditorPane;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class EventReminderPanel extends JPanel {
	private JLabel icon;
	private JEditorPane textArea;
	private Component horizontalStrut;

	
	
	public EventReminderPanel() {
		setOpaque(false);
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[]{23, 12, 107, 0};
		gridBagLayout.rowHeights = new int[]{37, 0};
		gridBagLayout.columnWeights = new double[]{0.0, 0.0, 1.0, Double.MIN_VALUE};
		gridBagLayout.rowWeights = new double[]{1.0, Double.MIN_VALUE};
		setLayout(gridBagLayout);
		
		icon = new JLabel("");
		icon.setAlignmentY(Component.TOP_ALIGNMENT);
		GridBagConstraints gbc_icon = new GridBagConstraints();
		gbc_icon.insets = new Insets(0, 0, 0, 5);
		gbc_icon.gridx = 0;
		gbc_icon.gridy = 0;
		add(icon, gbc_icon);
		
		horizontalStrut = Box.createHorizontalStrut(5);
		GridBagConstraints gbc_horizontalStrut = new GridBagConstraints();
		gbc_horizontalStrut.insets = new Insets(0, 0, 0, 5);
		gbc_horizontalStrut.gridx = 1;
		gbc_horizontalStrut.gridy = 0;
		add(horizontalStrut, gbc_horizontalStrut);
		
		textArea = new JEditorPane();
		textArea.setEditable(false);
		textArea.setOpaque(false);
		textArea.setAlignmentY(Component.TOP_ALIGNMENT);
		GridBagConstraints gbc_textArea = new GridBagConstraints();
		gbc_textArea.fill = GridBagConstraints.BOTH;
		gbc_textArea.gridx = 2;
		gbc_textArea.gridy = 0;
		add(textArea, gbc_textArea);

	}
	
	public void setIcon (ImageIcon image) {
		icon.setIcon(image);
	}
	
	public void setText (String text) {
		textArea.setText(text);
		setToolTipText(text);
	}

}
